<template>
	<view>
		
			<black v-for="(item,index) in datalist">
				<shop-taocan-item :active="item.id==selected.id" @onSelected="onSelected" :item="item"></shop-taocan-item> 

			</black>
			<view class="pd-bottom-20 pd-top-30">
				<u-empty v-if="datalist.length==0" :text="this.$t('没有套餐')"
				        mode="list"
				       
				>
				</u-empty>
			</view>
	
	</view>
</template>

<script>
	import {
		getFindByList
	} from '../../../api/taocan'

	export default {
		data() {
			return {
				datalist: [],
				selected:{
					id:0
				}
			}
		},

		mounted: function() {
			this.getfindData()
		},
		methods: {
			getfindData() {
				console.log("Hello")
				var the = this;
				getFindByList(2).then(res => {
					console.log("getFindByList------:", res)
					the.datalist = res
					console.log(the)
				})
			},
			open(e) {
				console.log('open', e)
			},
			close(e) {
				console.log('close', e)
			},
			change(e) {
				console.log('change', e)
			},
			onSelected:function(item){
				console.log(item)
				this.selected=item;
								this.$emit("onSelected",item)
			}
		}
	}
</script>

<style>
</style>
